package main.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.GregorianCalendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

@Entity(name = "Patient")
@Table(name = "patients")
public class Patient implements Serializable {

    /**
     * GUID for Serializable
     */
    private static final long serialVersionUID = 4914443405769909630L;
    
    private Integer id = 0;
    private String fName = "";
    private String middleInitial = "";
    private String lName = "";
    private String phone = "";
    private String address1 = "";
    private String address2 = "";
    private String city = "";
    private String state = "";
    private String gender = "";
    private String password = "";
    private Date dateAdded = GregorianCalendar.getInstance().getTime();
    
    public Patient() {
        
    }
    
    @Id
    @SequenceGenerator(name = "PatientsIdSeq", sequenceName = "patients_id_seq", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PatientsIdSeq")
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    @Column(name = "fname", length = 50)
    public String getfName() {
        return fName;
    }
    
    @Column(name = "mi", length = 1)
    public String getMiddleInitial() {
    	return middleInitial;
    }
    
    @Column(name = "lname", length = 50)
    public String getlName() {
        return lName;
    }
    
    @Column(name = "phone", length = 20)
    public String getPhone() {
    	return phone;
    }
    
    @Column(name = "address1", length = 40)
    public String getAddress1() {
    	return address1;
    }
    
    @NotNull
    @Column(name = "address2", length = 40)
    public String getAddress2() {
    	return address2;
    }
    
    @Column(name = "city", length = 40)
    public String getCity() {
    	return city;
    }
    
    @Column(name = "state", length = 40)
    public String getState() {
    	return state;
    }
    
    @Column(name = "gender", length = 1)
    public String getGender() {
    	return gender;
    }
    
    @Column(name = "password", length = 50)
    public String getPassword() {
        return password;
    }
    
    @Temporal(TemporalType.DATE)
    @Column(name = "date_added")
    public Date getDateAdded() {
        return dateAdded;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    public void setfName(String fName) {
        this.fName = fName;
    }
    
    public void setMiddleInitial(String middleInitial) {
    	this.middleInitial = middleInitial;
    }
    
    public void setlName(String lName) {
        this.lName = lName;
    }
    
    public void setPhone(String phone) {
    	this.phone = phone;
    }
    
    public void setAddress1(String address1) {
    	this.address1 = address1;
    }
    
    public void setAddress2(String address2) {
    	this.address2 = address2;
    }
    
    public void setCity(String city) {
    	this.city = city;
    }
    
    public void setState(String state) {
    	this.state = state;
    }
    
    public void setGender(String gender) {
    	this.gender = gender;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public void setDateAdded(Date dateAdded) {
        this.dateAdded = dateAdded;
    }

}
